"""Manages a game.
Used to control game flow.  Also manages all communication between players.

"""
import Board
from exceptions import Exception

class GameError(Exception):
	"""Exception class for Game."""
	def __init__(self,args=None):
		self.args=args

class Game:
	"""Handles all game-specific work."""
	def __init__(self,*players):
		"""Initializes game.
		
		Order of moves established based on order of player objects
		passed in."""
		self.board=Board.Board()
		self.players=players
		self.current_player=0

	def requestMove(self):
		"""Get a move from the player whose  turn it is."""
		raise GameError,'Implement requestMove'

	def copyBoard(self):
		"""Return a copy of the game board."""
		raise GameError,'Implement copyBoard'

	def whoseTurn(self):
		"""Return whose turn it is."""
		raise BoardError,'Implement whoseTurn'

	def sendAvatar(self,player):
		"""Sends the avatar representation of player."""
		raise BoardError,'Implement sendAvatar'

	def playerAvatars(self):
		"""Return a tuple of all of the avatars in the game in move order."""
		raise BoardError,'Implement playerAvatars'

	def sendAnnouncement(self,announcement,avatar):
		"""Send an announcment to a specific player as represented by avatar."""
		raise BoardError,'Implement sendAnnouncement'

	def makeAnnouncement(self,announcement):
		"""Sends an announcement to all players."""
		raise BoardError,'Implement makeAnnouncement'

	def announceWinnner(self,avatar):
		"""Announce the winner."""
		raise BoardError,'Implement announceWinner'

	def receiveRequest(self,request,avatar):
		"""Receive a request from a player."""
		raise BoardError,'Implement receiveRequest'

	def gameLoop(self):
		"""Starts game loop."""
		raise BoardError,'Implement gameLoop'
